Problem Note 55010: A style attribute with a format is not applied to an ACROSS variable's headers in PROC REPORT
A style attribute, like color, that is defined using a format is not applied to an ACROSS variable's headers in PROC REPORT. The sample code on the Full Code tab demonstrates the problematic syntax.
A hardcoded value for the style attribute is applied correctly.
To circumvent the problem, transpose the data set prior to the PROC REPORT step and control the style attributes for the individual columns. The sample code on the Full Code tab demonstrates this workaround.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft® Windows® for x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M1 | |
Z64 | 9.4 TS1M1 | 9.4 TS1M3 |
z/OS | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8 Pro x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8.1 Pro | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2008 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2008 R2 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M1 | 9.4 TS1M3 |
Microsoft Windows Server 2012 Std | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Enterprise 32 bit | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Enterprise x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Home Premium 32 bit | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Home Premium x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Professional 32 bit | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Professional x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Ultimate 32 bit | 9.4 TS1M1 | 9.4 TS1M3 |
Windows 7 Ultimate x64 | 9.4 TS1M1 | 9.4 TS1M3 |
64-bit Enabled AIX | 9.4 TS1M1 | 9.4 TS1M3 |
64-bit Enabled HP-UX | 9.4 TS1M1 | 9.4 TS1M3 |
64-bit Enabled Solaris | 9.4 TS1M1 | 9.4 TS1M3 |
HP-UX IPF | 9.4 TS1M1 | 9.4 TS1M3 |
Linux for x64 | 9.4 TS1M1 | 9.4 TS1M3 |
Solaris for x64 | 9.4 TS1M1 | 9.4 TS1M3 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
proc format;
value $gender 'F'='pink' 'M'='lightblue';
run;
/* The pink and lightblue color attributes are not applied to the headers for the Sex variable. */
proc report data=sashelp.class;
col sex,(weight height);
define sex / across style(header)=[background=$gender.] ' ';
run;
/* Workaround: Transpose the data and use inline formatting to control the color attribute. */
proc transpose data=sashelp.class out=class;
by name sex;
var weight height;
run;
proc transpose data=class out=class2;
by name;
id sex _name_;
var col1;
run;
ods escapechar="^";
proc report data=class2;
col ('^S={background=pink}F' Fweight Fheight) ('^S={background=lightblue}M' Mweight Mheight);
define Fweight /'Weight';
define Fheight / 'Height';
define Mweight / 'Weight';
define Mheight / 'Height';
run;
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2015-01-19 16:07:34 |
Date Created: | 2015-01-16 11:24:46 |